# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=emacs-dash
pkgver=2.19.1_git20240216
_gitrev=5df7605da5a080df769d4f260034fb0e5e86a7a4
pkgrel=0
_pkgreal=dash
pkgdesc="Modern list library for Emacs"
url="https://github.com/magnars/dash.el"
arch="noarch"
license="GPL-3.0-or-later"
depends="cmd:emacs"
makedepends="emacs-nox"
source="https://github.com/magnars/dash.el/archive/$_gitrev/emacs-dash-$_gitrev.tar.gz"
builddir="$srcdir/dash.el-$_gitrev"

build() {
	emacs -batch -q -no-site-file -L . \
		-eval '(setq byte-compile-error-on-warn t)' \
		-f batch-byte-compile \
		dash.el
}

check() {
	emacs -batch -q -no-site-file -L . \
		-l dev/examples -f ert-run-tests-batch-and-exit
}

package() {
	install -Dvm644 dash.el dash.elc \
		-t "$pkgdir"/usr/share/emacs/site-lisp/

	cd "$pkgdir"/usr/share/emacs/site-lisp
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-loaddefs.el\")"
}

sha512sums="
88e212f781f40040c7e906d5b170c8d0a1c0dece6800f569ed62955299d6019af31614899c9f2006b3a3b6733b2972d7b99e374874b908f7aec57b6964787e44  emacs-dash-5df7605da5a080df769d4f260034fb0e5e86a7a4.tar.gz
"
